const moment = require('moment');
const date = new Date();
console.log('date:' + date);

var timestamp = new Date().getTime();
console.log('timestamp:' + timestamp);
// const pubtime = moment(date).format('YYYY-MM-DD HH:mm:ss');
var mod = 1000 * 60 * 5;

const startTTT = new Date(Math.floor(timestamp / mod) * mod) + mod;
console.log('startTTT:' + startTTT);
const end_time = moment(new Date(startTTT)).format('YYYY-MM-DD HH:mm:ss');
console.log('end_time:' + end_time);


const start_time = moment(end_time).unix();
console.log('start_time:' + start_time);

const times = moment(start_time * 1000).format('YYYY-MM-DD HH:mm:ss');
console.log('times:' + times);
// function getData(n){
//   n=new Date(n)
//   const time =  n.toLocaleDateString().replace(/\//g, "-") + " " + n.toTimeString().substr(0, 8);
//   console.log('startTTT:' + time);
// }
// getData(startTTT); 

// const min = (Math.floor(timestamp / mod) * mod) + mod;
// console.log('min:' + min);


// const end_time = moment(min).format('YYYY-MM-DD HH:mm:ss');
// console.log('end_time:' + end_time);

// const newDate = new Date(min);
// console.log('newDate:' + newDate);

let array = [];
// array.push('asdfd', 'asdfsdfds');
// console.log('array:' + array[1]);
const array2 = [1];
array = array.concat(array2);
console.log('array:' + array);

// const array1 = [];
// const array2 = ['d', 'e', 'f'];
// const array3 = array1.concat(array2);

// console.log(array3);